public class Auxiliar {
	
	public static boolean isBetween(double mayor, double menor, double valor) {  // Return true if c is between a and b.
	    return menor > mayor ? valor > mayor && valor < menor : valor > menor && valor < mayor;
	}
    
	public static int getMaxModOfNumber(int value, int mod)
	{
		int returnVal = value%mod;
		if (returnVal == 0)
			return mod;
		else
			return returnVal;
	}
	
    public static double getMaxValue(double[] numbers){   //Return the maxValue of an Array of doubles
    	  double maxValue = numbers[0];  
    	  for(int i=1;i < numbers.length;i++){  
    	    if(numbers[i] > maxValue){  
    	      maxValue = numbers[i];
    	    }  
    	  }  
    	 
		return maxValue;  
    }
    
    public static double getMinValue(double[] numbers){  //Return the MinValue of an Array of doubles
  	  double minValue = numbers[0];  
  	  for(int i=1;i<numbers.length;i++){  
  	    if(numbers[i] < minValue){  
  	      minValue = numbers[i];  
  	    }  
  	  }  
  	  return minValue;  
    }
    
    public static float SQR(float a){
        return a*a;
	}
	
	public static double SQR(double a){
	        return a*a;             
	}
	
	public static double EuclideanDistance(double firstX, double firstY, double secondX, double secondY) {
		return Math.sqrt( Math.pow(secondX - firstX, 2) + Math.pow(secondY - firstY, 2));
	}
}